package com.hkd.SSM;

import com.hkd.SSM.dao.UserDao;
import com.hkd.SSM.dao.UserService;
import com.hkd.SSM.factory.UserDaoFactory;
import com.hkd.SSM.impl.UserDaoImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    private static UserDao userDao;
    public static void main(String[] args) {

        ClassPathXmlApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
//        app.registerShutdownHook();
//        userDao=(UserDao) app.getBean("userDao");
//        userDao.save();
        UserService userService=(UserService) app.getBean("userService");
        userService.save();
        app.close();

    }
}